<?php
abstract class Fender_Singleton extends Fender_Base_Abstract
{
	protected function __construct()
	{
	}

	static public function single()
	{
		static $_instance = array();
		$args = func_get_args();
		$key = serialize($args);
		$className = get_called_class();
		if ($_instance[$key] instanceof $className) {
			return $_instance[$key];
		}
		$_instance[$key] = new $className();
		$method = new ReflectionMethod($className, 'construct');
		$method->invokeArgs($_instance[$key], $args);
		return $_instance[$key];
	}

	public function construct($params)
	{
	}

	protected function __clone()
	{
	}

	protected function __wakeup()
	{
	}

	protected function __sleep()
	{
	}
}
